/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package vn.webapp.model;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import vn.webapp.dto.DataPage;

/**
 *
 * @author Tonytran
 */
@Entity
@Table(name = "timetabling")
public class Timetabling implements Serializable {

    @Id
    @GeneratedValue
    @Column(name = "timetabling_id")
    private int timetabling_id;
    
    @Column(name = "courseteacher_id")
    private int courseteacher_id;
    
    @Column(name = "room_id")
    private int room_id;
    
    @Column(name = "day")
    private int day;
    
    @Column(name = "slot")
    private int slot;
    
    @Column(name = "timerange")
    private int timerange;
    
    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @JoinColumn(name="courseteacher_id", insertable = false, updatable = false, nullable = false, unique = true)
    public CoursingTimeTabling coursing;
    
    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @JoinColumn(name="room_id", insertable = false, updatable = false, nullable = false, unique = true)
    public Rooms rooms;

    public int getTimetabling_id() {
        return timetabling_id;
    }

    public void setTimetabling_id(int timetabling_id) {
        this.timetabling_id = timetabling_id;
    }

    public int getCourseteacher_id() {
        return courseteacher_id;
    }

    public void setCourseteacher_id(int courseteacher_id) {
        this.courseteacher_id = courseteacher_id;
    }

    public int getRoom_id() {
        return room_id;
    }

    public void setRoom_id(int room_id) {
        this.room_id = room_id;
    }


    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public int getSlot() {
        return slot;
    }

    public void setSlot(int slot) {
        this.slot = slot;
    }

    public int getTimerange() {
        return timerange;
    }

    public void setTimerange(int timerange) {
        this.timerange = timerange;
    }

    public CoursingTimeTabling getCoursing() {
        return coursing;
    }

    public void setCoursing(CoursingTimeTabling coursing) {
        this.coursing = coursing;
    }

    public Rooms getRooms() {
        return rooms;
    }

    public void setRooms(Rooms rooms) {
        this.rooms = rooms;
    }
}
